﻿<script type="text/javascript">
    $('input[type=text]').each(function () {
        var req = $(this).attr('data-val-required');
        var label = $('label[for="' + $(this).attr('id') + '"]');
        if (undefined != req) {            
            var text = label.text();
            if (text.length > 0) {
                label.append(':');
                label.append('<span style="color:red"> (*)</span>');
            }
        }
        else {
            label.append(':');
        }
    });
    $('input[type=password]').each(function () {
        var req = $(this).attr('data-val-required');
        var label = $('label[for="' + $(this).attr('id') + '"]');
        if (undefined != req) {            
            var text = label.text();
            if (text.length > 0) {
                label.append(':');
                label.append('<span style="color:red"> (*)</span>');
            }
        }
        else {
            label.append(':');
        }
    });
    $('select').each(function () {
        var req = $(this).attr('data-val-required');
        var label = $('label[for="' + $(this).attr('id') + '"]');
        if (undefined != req) {            
            var text = label.text();
            if (text.length > 0) {
                label.append(':');
                label.append('<span style="color:red"> (*)</span>');
            }
        }
        else {
            label.append(':');
        }
    });
    $('textarea').each(function () {
        var req = $(this).attr('data-val-required');
        var label = $('label[for="' + $(this).attr('id') + '"]');
        if (undefined != req) {            
            var text = label.text();
            if (text.length > 0) {
                label.append(':');
                label.append('<span style="color:red"> (*)</span>');
            }
        }
        else {
            label.append(':');
        }        
    });
</script>